package leyou.search.controller;

import com.leyou.api.R;
import com.leyou.common.to.Goods;
import leyou.search.service.EsGoodsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/search")
public class putController {

    @Resource
    private EsGoodsService goodsService;

    @PostMapping("/goods")
    public R bulkIndex(@RequestBody Goods goods ) throws IOException {
        Boolean aBoolean = goodsService.bulkIndex(goods);
        return aBoolean?R.ok():R.error();
    }

}
